<?php
if (isset($_SESSION['admin-login'])) {
	if (isset($_POST['upload'])) {
		if ($_FILES['image']['error'] == 0) {
			$upload = asset_path()."/images/slideshow/".$_FILES['image']['name'];
			move_uploaded_file($_FILES['image']['tmp_name'],$upload);
			$_SESSION['status-slideshow'] = "File telah diupload";
			header("Location: ".site()."/".$param[0]."/".$param[1]);
		} else {
			$_SESSION['status-slideshow'] = "Upload gagal. Error Code : ".$_FILES['image']['error'];
			header("Location: ".site()."/".$param[0]."/".$param[1]);
		}
	}
} else {
	$_SESSION['status-login'] = "Log in terlebih dahulu untuk melanjutkan";
	header("Location: ".site()."/".$param[0]."/login");
}
?>